package com.leetcode.alibaba;

public class 二叉树的最大深度 {

	public int maxDepth(TreeNode root) {
		if (root == null) {
			return 0;
		}
		int lDepth = maxDepth(root.left);
		int rDepth = maxDepth(root.right);
		return Math.max(lDepth, rDepth) + 1;
	}
}

class TreeNode {
	int val = 0;
	TreeNode left = null;
	TreeNode right = null;
}
